import {h, init} from 'snabbdom'
import style from 'snabbdom/modules/style'
import eventlisteners from 'snabbdom/modules/eventlisteners'

// 注册模块
const patch = init([
    style,
    eventlisteners,
])

let vnode = h('div', {
    style: {
        backgroundColor: 'red',
    },
    on: {
        click: () => {
            console.log('点击事件')
        }
    }
}, [
    h('h1', 'h1'),
    h('p', 'p')
])

let app = document.querySelector('#app')

let oldvnode = patch(app, vnode)